<?php
//插入新的用户
require_once('../config.php');

    $name = $_POST['name'];
    $address = $_POST['address'];
    $salary = $_POST['salary'];
    $gender = $_POST['gender'];

    $sql = "INSERT INTO employees(name,address,salary,gender) VALUES ('$name','$address','$salary','$gender')";
    $result = $link->query($sql);

	if($result){
    $resp['status'] = 'success';
	}else{
		$resp['status'] = 'failed';
		$resp['msg'] = 'An error occured while saving the data. Error: '.$link->error;
	}
    echo json_encode($resp);

?>